package haiyangwangwork.day04.homework;

public class Rectangle extends Shape{
    private int width;
    private int height;
    @Override
    public void drew(){
        for (int i=1;i<=width;i++){

            for (int j=1;j<=i;j++){
                System.out.print("*");
            }

            System.out.println("");
        }
    }
    public Rectangle(int width, int height) {
        this.width = width;
        this.height = height;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        if ((width>=1)&(width<=15)){
            this.width = width;
        }else {
            return;
        }

    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        if ((width>=1)&(width<=15)){
            this.height = height;
        }else {
            return;
        }

    }
}
